<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'activityTeam.label', default: 'activityTeam')}"/>
    <title>编辑活动团队</title>
</head>

<body>
<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>编辑活动团队</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="activity" action="show" id="${this.activityTeam?.activity?.id}">团队列表</g:link>

                    </li>
                    <li class="breadcrumb-item">编辑活动团队</li>
                </ul>
            </div>
        </div>

        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message" role="status">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${this.activityTeam}">
                <ul class="errors" role="alert">
                    <g:eachError bean="${this.activityTeam}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                                error="${error}"/></li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
            <div class="card">
                <div class="card-header">
                    <h5>编辑活动团队</h5>

                    <div class="card-header-right">
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">

                    <g:form resource="${this.activityTeam}" method="PUT">
                        <div class="form-group row">
                            <label class="col-md-2 col-form-label is-required">用户</label>

                            <div class="col-md-3">
                                <input class="form-control" type="hidden" name="activity.id"
                                       value="${this.activityTeam?.activity?.id}">
                               <g:textField class="hidden" name="user.id" value="${this.activityTeam?.user?.id}"/>
                               <g:textField class="form-control" disabled="disabled" name="userName" value="${this.activityTeam?.user}"/>

                                <!-- <g:select class="form-control" name="user.id" optionKey="id"
                                          from="${this.userList}" value="${this.activityTeam?.user?.id}"
                                          noSelection="${['': '请选择']}"></g:select> -->
                            </div>

                            <label class="col-md-2 col-form-label is-required">权限</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="teamRole.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.activityTeam?.teamRole?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton class="btn btn-info" name="create" value="保存"/>
                            </div>
                        </div>
                    </g:form>
                </div>

            </div>
        </div>

    </div>
</div>

</body>
</html>
